package com.dingreading.cloud.mall.service.impl;

import com.dingreading.cloud.mall.entity.OrderFormLog;
import com.dingreading.cloud.mall.entity.table.OrderFormLogTableDef;
import com.dingreading.cloud.mall.mapper.OrderFormLogMapper;
import com.dingreading.cloud.mall.service.OrderFormLogService;
import com.mybatisflex.core.query.QueryWrapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 服务层实现。
 *
 * @author Administrator
 * @since 2023-11-22
 */
@Service
public class OrderFormLogServiceImpl extends BaseServiceImpl<OrderFormLogMapper, OrderFormLog, OrderFormLogTableDef> implements OrderFormLogService {

    @Override
    protected OrderFormLogTableDef getTable() {
        return OrderFormLogTableDef.orderFormLog;
    }

    @Override
    public List<OrderFormLog> getByCode(String code) {
        QueryWrapper wrapper = QueryWrapper.create()
                .where(table.code.eq(code))
                .orderBy(table.id.desc());

        return getMapper().selectListByQuery(wrapper);
    }

}
